package org.particlethink.response;

import io.swagger.v3.oas.annotations.media.Schema;
import org.particlethink.model.Material;

public class MaterialInfo {
	private Integer id;
    @Schema(description = "物料名称")
	private String name;
    @Schema(description = "规格")
	private String specification;
    @Schema(description = "物料编码")
	private String no;
    @Schema(description = "发货单发货数量")
	private Integer count;
    @Schema(description = "发货单项目确认数量")
	private Integer confirmCount;
    @Schema(description = "质量标准")
    private String quality;//质量标准
    @Schema(description = "单位")
    private String unit;//单位
    @Schema(description = "型号")
    private String typ;//型号
    private String categoryId;
    private String parentCategoryId;

    private MaterialKindResponse category;

    @Schema(description = "物料大类")
    private MaterialKindResponse parentCategory;

    public String getQuality() {
        return quality;
    }

    public void setQuality(String quality) {
        this.quality = quality;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getTyp() {
        return typ;
    }

    public void setTyp(String typ) {
        this.typ = typ;
    }

    public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSpecification() {
		return specification;
	}

	public void setSpecification(String specification) {
		this.specification = specification;
	}

	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public Integer getConfirmCount() {
		return confirmCount;
	}

	public void setConfirmCount(Integer confirmCount) {
		this.confirmCount = confirmCount;
	}

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public MaterialKindResponse getCategory() {
        return category;
    }

    public void setCategory(MaterialKindResponse category) {
        this.category = category;
    }

    public MaterialKindResponse getParentCategory() {
        return parentCategory;
    }

    public void setParentCategory(MaterialKindResponse parentCategory) {
        this.parentCategory = parentCategory;
    }

    public String getParentCategoryId() {
        return parentCategoryId;
    }

    public void setParentCategoryId(String parentCategoryId) {
        this.parentCategoryId = parentCategoryId;
    }

    public static MaterialInfo createMaterialInfo(Material material){
        MaterialInfo materialListResponse = new MaterialInfo();
        materialListResponse.setId(material.getId());
        materialListResponse.setName(material.getName());
        materialListResponse.setSpecification(material.getSpecification());
        materialListResponse.setNo(material.getNo());
        materialListResponse.setCategoryId(material.getCategoryId());
        materialListResponse.setUnit(material.getUnit());
        materialListResponse.setQuality(material.getQuality());
        materialListResponse.setTyp(material.getTyp());
        materialListResponse.setParentCategoryId(material.getParentCategoryId());
        return materialListResponse;
    }
}
